|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfurny.ga.RoomVector
public final class RoomVector
The room vector is a tuple of x- and y-coordinates and rotation steps. It is part of the furniture genotype.
Field Summary | |
---|---|
private static int |
MAX_ROTATION
|
private static float |
ROTATION_DEGREES
|
private int |
rotGene
|
private int |
xGene
|
private int |
yGene
|
Constructor Summary | |
---|---|
RoomVector(int xGene,
int yGene,
int rotationSteps)
Creates a new room vector and sets all fields. |
Method Summary | |
---|---|
protected RoomVector |
clone()
|
float |
diffAngleDeg(RoomVector vec)
Calculates the degrees difference between the rotations. |
int |
diffRotation(RoomVector vec)
Calculates the rotation steps difference between the rotations. |
float |
distance(RoomVector vec)
Calculates the euklidean distance between this an the other room vector. |
boolean |
equals(java.lang.Object obj)
|
RoomVector |
getRotatedInstance(int rotationSteps)
Creates a new room vector that is rotated by the given number of 90° steps. |
float |
getRotation()
Getter for the rotation. |
int |
getRotationSteps()
Get the gene for the rotation. |
RoomVector |
getTranslatedInstance(int x,
int y)
Creates a new room vector that is translated by x and y. |
float |
getX()
Get the real x coordinate. |
int |
getXGene()
Get the gene for x. |
float |
getY()
Get the real y coordinate. |
int |
getYGene()
Get the gene for y. |
int |
hashCode()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final float ROTATION_DEGREES
private static final int MAX_ROTATION
private final int xGene
private final int yGene
private final int rotGene
Constructor Detail |
---|
public RoomVector(int xGene, int yGene, int rotationSteps)
xGene
- The gene for x (in centimeters).yGene
- The gene for y (in centimeters).rotationSteps
- The number of the 90° rotations.Method Detail |
---|
public int getXGene()
public int getYGene()
public float getX()
public float getY()
public float getRotation()
public int getRotationSteps()
public RoomVector getTranslatedInstance(int x, int y)
x
- Translation x (centimeters).y
- Translation y (centimeters).
public RoomVector getRotatedInstance(int rotationSteps)
rotationSteps
- Steps to rotate.
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
protected RoomVector clone()
clone
in class java.lang.Object
public float distance(RoomVector vec)
vec
- The other room vector.
public float diffAngleDeg(RoomVector vec)
vec
- The other room vector.
public int diffRotation(RoomVector vec)
vec
- The other room vector.
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |